package cn.xizikelif.org.controller;

import cn.xizikelif.basic.util.PageList;
import cn.xizikelif.org.domain.PerAop;
import cn.xizikelif.org.query.PerAopQuery;
import cn.xizikelif.org.service.PerAopService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/log")
@Api(value = "部门的API",description = "部门相关的CRUD功能")
public class LogAopController {

    @Autowired
    private PerAopService perAopService;

//    /*查询单个*/
//    @GetMapping("/{id}")
//    @ApiOperation(value = "通过ID查询" )
//    public LogAop findById(@ApiParam(value="主键id",readOnly = true) @PathVariable("id") long id){
//        return perAopService.findById(id);
//    }

/*    *//*查询一条*//*
    @GetMapping("/e/{id}")
    public List<PerAop> findByOne(@PathVariable("id") Long id){
        return perAopService.findByOne(id);
    }*/
/*
    *//*查询全部*//*
    @GetMapping
    public List<LogAop> findAll(){
        return perAopService.findAll();
    }*/

 /*   *//*添加和修改*//*
    @PutMapping()
    public AjaxResult addOrUpdate(@RequestBody PerAop perAop){
        if(null != perAop.getId()){
            // 修改
            perAopService.update(perAop);

        }else {
            // 添加
            perAopService.add(perAop);
        }
        return AjaxResult.me().success();
    }*/

//    /*删除*/
//    @DeleteMapping("/{id}")
//    public AjaxResult delete(@PathVariable("id") long id){
//        perAopService.delete(id);
//        return AjaxResult.me().success();
//    }

    /*分页查询*/
    @PostMapping
    public PageList<PerAop> queryByPage(@RequestBody PerAopQuery query){
        return perAopService.queryByPage(query);
    }
//
//    /*批量删除*/
//    @PatchMapping
//    public AjaxResult bachDelete(@RequestBody List<Long> ids){
//       perAopService.bachDelete(ids);
//        return AjaxResult.me().success();
//    }

}
